package com.hdoit.kylin.selfcommon.utils;

public class RandomColor {
	public String getRandomColor(){
		int r = (int) (Math.random() * 256);
		int g = (int) (Math.random() * 256);
		int b = (int) (Math.random() * 256);
		
		String color = "#" + getStringFromInt(r) + getStringFromInt(g) + getStringFromInt(b);
		return color;
	}
	public String getRandomLightColor(){
		int r = (int) (Math.random() * 81) + 175;
		int g = (int) (Math.random() * 81) + 175;
		int b = (int) (Math.random() * 81) + 175;
		
		String color = "#" + getStringFromInt(r) + getStringFromInt(g) + getStringFromInt(b);
		return color;
	}
	public String getRandomMiddleColor(){
		int r = (int) (Math.random() * 95) + 81;
		int g = (int) (Math.random() * 95) + 81;
		int b = (int) (Math.random() * 95) + 81;
		
		String color = "#" + getStringFromInt(r) + getStringFromInt(g) + getStringFromInt(b);
		return color;
	}
	public String getRandomDarkColor(){
		int r = (int) (Math.random() * 100);
		int g = (int) (Math.random() * 100);
		int b = (int) (Math.random() * 100);
		
		String color = "#" + getStringFromInt(r) + getStringFromInt(g) + getStringFromInt(b);
		return color;
	}
	private String getStringFromInt(int num){
		String string = Integer.toHexString(num);
		if (string.length() < 2) {
			string = "0" + string;
		}
		return string;
	}
}